home *** CD-ROM | disk | FTP | other *** search
- #include "Commands.h"
- #include "CBartender.h"
- #include "InkApp.h"
- #include "InkDoc.h"
- #include "Global.h"
-
- extern OSType gSignature;
- extern CBartender *gBartender;
-
- #define kExtraMasters 10
- #define kRainyDayFund 45000
- #define kCriticalBalance 40000
- #define kToolboxBalance 20000
-
- void RecognizerInit(void);
- void main()
- {
- InkApp *editApp;
- editApp = new(InkApp);
- editApp->IEditApp();
- editApp->Run();
- editApp->Exit();
- }
-
- void InkApp::IEditApp(void) {
- CApplication::IApplication(kExtraMasters,kRainyDayFund,kCriticalBalance,kToolboxBalance);
- RecognizerInit();
- }
-
- void InkApp::StartUpAction(short numPreloads) {
- FlushEvents(everyEvent, 0);
- }
-
- void InkApp::SetUpFileParameters(void) {
- inherited::SetUpFileParameters(); /* Be sure to call the default method */
- sfNumTypes = 1;
- sfFileTypes[0] = 'INKd';
- gSignature = 'INKe';
- }
-
- void InkApp::CreateDocument() {
- InkDoc *theDocument = NULL;
- TRY {
- theDocument = new(InkDoc);
- theDocument->IEditDoc(this, TRUE);
- theDocument->NewFile();
- }
- CATCH {
- ForgetObject( theDocument);
- }
- ENDTRY;
- }
-
- void InkApp::OpenDocument(SFReply *macSFReply) {
- InkDoc *theDocument = NULL;
- TRY {
- theDocument = new(InkDoc);
- theDocument->IEditDoc(this, TRUE);
- theDocument->OpenFile(macSFReply);
- }
- CATCH {
- ForgetObject( theDocument);
- }
- ENDTRY;
- }
-
- void InkApp::SetUpMenus(void) {
- inherited::SetUpMenus();
- AddResMenu(GetMHandle(MENUfont), 'FONT');
- gBartender->SetDimOption(MENUfont, dimNONE);
- gBartender->SetDimOption(MENUsize, dimNONE);
- gBartender->SetDimOption(MENUstyle, dimNONE);
- gBartender->SetUnchecking(MENUfont, TRUE);
- gBartender->SetUnchecking(MENUsize, TRUE);
- gBartender->SetUnchecking(MENUstyle, TRUE);
- gBartender->SetDimOption(128, dimNONE);
- gBartender->SetDimOption(129, dimNONE);
- gBartender->SetDimOption(130, dimNONE);
- gBartender->SetDimOption(131, dimNONE);
- gBartender->SetDimOption(132, dimNONE);
- gBartender->SetUnchecking(130, TRUE);
- gBartender->SetUnchecking(131, TRUE);
- gBartender->SetUnchecking(132, TRUE);
- }
-